as const satisfies T
https://speakerdeck.com/tonkotsuboy_com/typescript-4-dot-9noas-const-satisfiesgabian-li-160d825b-7765-4c2b-945d-bb72cc389557
#??
なぜリストに対しては使えない?
code:ts
type Place = {
label: string;
picUrl: string;
};
const places = [
{
label: 'その他',
picUrl: 'https://static.hoge/place-living.jpeg',
},
{
label: 'リビング',
picUrl: 'https://static.hoge/place-living.jpeg',
},
] as const satisfies Place[]; // error
この値のplacesから、
type Name = (typeof places)[number]['label'];としたい